#include <iostream>
#include <future>
#include <unistd.h>

int add(int a, int b)
{
    std::cout <<"in\n";
    return a + b;
}

int main()
{
    std::future<int> res = std::async(std::launch::async, add, 11, 22);

    sleep(2);
    std::cout << "----------------" << std::endl;

    std::cout << res.get() << std::endl;
    return 0;
}